# Fit the PMM paper's core model.
# This replicates the published paper
library(uds)
data(democracy1946.2000)
data.uds <- prepare.uds(democracy)

print(Sys.time())
post.uds <- mroprobit(data=data.uds, 
                      sigma.mh=c(0.015, 0.065, 0.022, 0.006, 0.043,
                      0.044, 0.0025, 0.024, 0.012, 0.01),
                      save.traits = TRUE, save.perceived.traits =
                      TRUE, mcmc = 500000, burnin = 500000, thin =
                      100, verbose = 100000, seed = 3333, chains=1,
                      disperse=F)
print(Sys.time())
save(post.uds, file="post.uds.RData")

rm(list=ls()) # free up some RAM

# Fit the core model for to the 1946-2008 dataset
#library(uds)
#data(democracy1946.2008)
#data.uds <- prepare.uds(democracy, include.extra=T)
#
#print(Sys.time())
#post.uds <- mroprobit(data=data.uds, 
#                      sigma.mh=c(0.015, 0.065, 0.022, 0.006, 0.043,
#                      0.044, 0.0025, 0.024, 0.012, 0.008, 0.055, 0.03),
#                      save.traits = TRUE, save.perceived.traits =
#                      TRUE, mcmc = 500000, burnin = 500000, thin =
#                      100, verbose = 1000, seed = 11111, chains=1,
#                      disperse=F)
#print(Sys.time())
#save(post.uds, file="post.uds.4608.12.RData")
#
#rm(list=ls()) # free up some RAM
